(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

foldl(x, Cons(S(0), xs)) → foldl(S(x), xs)
foldl(S(0), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0)) → S(x)
op(S(0), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Rewrite Strategy: INNERMOST

(1) DecreasingLoopProof (EQUIVALENT transformation)

The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
foldl(x, Cons(S(0), xs)) →+ foldl(S(x), xs)
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [xs / Cons(S(0), xs)].
The result substitution is [x / S(x)].

(2) BOUNDS(n^1, INF)

(3) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(4) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

foldl(x, Cons(S(0'), xs)) → foldl(S(x), xs)
foldl(S(0'), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0')) → S(x)
op(S(0'), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

S is empty.
Rewrite Strategy: INNERMOST

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

Innermost TRS:
Rules:
foldl(x, Cons(S(0'), xs)) → foldl(S(x), xs)
foldl(S(0'), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0')) → S(x)
op(S(0'), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Types:
foldl :: 0':S → Cons:Nil → 0':S
Cons :: 0':S → Cons:Nil → Cons:Nil
S :: 0':S → 0':S
0' :: 0':S
foldr :: 0':S → Cons:Nil → 0':S
op :: 0':S → 0':S → 0':S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0':S → Cons:Nil → Cons:Nil
hole_0':S1_0 :: 0':S
hole_Cons:Nil2_0 :: Cons:Nil
hole_True:False3_0 :: True:False
gen_0':S4_0 :: Nat → 0':S
gen_Cons:Nil5_0 :: Nat → Cons:Nil

(7) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
foldl, foldr

(8) Obligation:

Innermost TRS:
Rules:
foldl(x, Cons(S(0'), xs)) → foldl(S(x), xs)
foldl(S(0'), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0')) → S(x)
op(S(0'), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Types:
foldl :: 0':S → Cons:Nil → 0':S
Cons :: 0':S → Cons:Nil → Cons:Nil
S :: 0':S → 0':S
0' :: 0':S
foldr :: 0':S → Cons:Nil → 0':S
op :: 0':S → 0':S → 0':S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0':S → Cons:Nil → Cons:Nil
hole_0':S1_0 :: 0':S
hole_Cons:Nil2_0 :: Cons:Nil
hole_True:False3_0 :: True:False
gen_0':S4_0 :: Nat → 0':S
gen_Cons:Nil5_0 :: Nat → Cons:Nil

Generator Equations:
gen_0':S4_0(0) ⇔ 0'
gen_0':S4_0(+(x, 1)) ⇔ S(gen_0':S4_0(x))
gen_Cons:Nil5_0(0) ⇔ Nil
gen_Cons:Nil5_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil5_0(x))

The following defined symbols remain to be analysed:
foldl, foldr

(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol foldl.

(10) Obligation:

Innermost TRS:
Rules:
foldl(x, Cons(S(0'), xs)) → foldl(S(x), xs)
foldl(S(0'), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0')) → S(x)
op(S(0'), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Types:
foldl :: 0':S → Cons:Nil → 0':S
Cons :: 0':S → Cons:Nil → Cons:Nil
S :: 0':S → 0':S
0' :: 0':S
foldr :: 0':S → Cons:Nil → 0':S
op :: 0':S → 0':S → 0':S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0':S → Cons:Nil → Cons:Nil
hole_0':S1_0 :: 0':S
hole_Cons:Nil2_0 :: Cons:Nil
hole_True:False3_0 :: True:False
gen_0':S4_0 :: Nat → 0':S
gen_Cons:Nil5_0 :: Nat → Cons:Nil

Generator Equations:
gen_0':S4_0(0) ⇔ 0'
gen_0':S4_0(+(x, 1)) ⇔ S(gen_0':S4_0(x))
gen_Cons:Nil5_0(0) ⇔ Nil
gen_Cons:Nil5_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil5_0(x))

The following defined symbols remain to be analysed:
foldr

(11) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0)) → gen_0':S4_0(1), rt ∈ Ω(1 + n180)

Induction Base:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(0)) →RΩ(1)
gen_0':S4_0(1)

Induction Step:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(+(n18_0, 1))) →RΩ(1)
op(0', foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0))) →IH
op(0', gen_0':S4_0(1)) →RΩ(1)
S(0')

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(12) Complex Obligation (BEST)

(13) Obligation:

Innermost TRS:
Rules:
foldl(x, Cons(S(0'), xs)) → foldl(S(x), xs)
foldl(S(0'), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0')) → S(x)
op(S(0'), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Types:
foldl :: 0':S → Cons:Nil → 0':S
Cons :: 0':S → Cons:Nil → Cons:Nil
S :: 0':S → 0':S
0' :: 0':S
foldr :: 0':S → Cons:Nil → 0':S
op :: 0':S → 0':S → 0':S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0':S → Cons:Nil → Cons:Nil
hole_0':S1_0 :: 0':S
hole_Cons:Nil2_0 :: Cons:Nil
hole_True:False3_0 :: True:False
gen_0':S4_0 :: Nat → 0':S
gen_Cons:Nil5_0 :: Nat → Cons:Nil

Lemmas:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0)) → gen_0':S4_0(1), rt ∈ Ω(1 + n180)

Generator Equations:
gen_0':S4_0(0) ⇔ 0'
gen_0':S4_0(+(x, 1)) ⇔ S(gen_0':S4_0(x))
gen_Cons:Nil5_0(0) ⇔ Nil
gen_Cons:Nil5_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil5_0(x))

No more defined symbols left to analyse.

(14) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0)) → gen_0':S4_0(1), rt ∈ Ω(1 + n180)

(15) BOUNDS(n^1, INF)

(16) Obligation:

Innermost TRS:
Rules:
foldl(x, Cons(S(0'), xs)) → foldl(S(x), xs)
foldl(S(0'), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0')) → S(x)
op(S(0'), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Types:
foldl :: 0':S → Cons:Nil → 0':S
Cons :: 0':S → Cons:Nil → Cons:Nil
S :: 0':S → 0':S
0' :: 0':S
foldr :: 0':S → Cons:Nil → 0':S
op :: 0':S → 0':S → 0':S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0':S → Cons:Nil → Cons:Nil
hole_0':S1_0 :: 0':S
hole_Cons:Nil2_0 :: Cons:Nil
hole_True:False3_0 :: True:False
gen_0':S4_0 :: Nat → 0':S
gen_Cons:Nil5_0 :: Nat → Cons:Nil

Lemmas:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0)) → gen_0':S4_0(1), rt ∈ Ω(1 + n180)

Generator Equations:
gen_0':S4_0(0) ⇔ 0'
gen_0':S4_0(+(x, 1)) ⇔ S(gen_0':S4_0(x))
gen_Cons:Nil5_0(0) ⇔ Nil
gen_Cons:Nil5_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil5_0(x))

No more defined symbols left to analyse.

(17) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
foldr(gen_0':S4_0(1), gen_Cons:Nil5_0(n18_0)) → gen_0':S4_0(1), rt ∈ Ω(1 + n180)

(18) BOUNDS(n^1, INF)